export default  {
  ignores: [(commit) => commit.includes("init")],
  extends: ["@commitlint/config-conventional"],
  rules: {
    "type-enum": [2, "always", [
      "feat",     //新功能
      "fix",      //修复缺陷
      "docs",     //文档变更
      "style",    //代码格式（不影响功能的如分号、空格更改）
      "refactor", //代码重构（不包括 bug 修复、功能新增）
      "perf",     // 性能优化
      "test",     //添加疏漏测试或已有测试改动
      "build",    //构建流程、外部依赖变更（如升级npm包、修改vite配置等）
      "ci",       //修改CI配置、脚本
      "chore",    //对构建过程或辅助工具和库的更改（不影响源文件、测试用例）
      "revert",   //回滚commit
      "wip",      //表示代码正在开发，不可合并
      "release"   //合并代码带release分支
    ]],
    "body-leading-blank": [2, "always"],
    "footer-leading-blank": [1, "always"],
    "header-max-length": [2, "always", 108],
    "subject-empty": [2, "never"],
    "type-empty": [2, "never"],
    "subject-case": [0],
  },
  prompt: {
    messages: {
      type: "选择你要提交的类型 :",
      scope: "选择一个提交范围[可选]:",
      customScope: "请输入自定义的提交范围 :",
      subject: "请简要描述提交 :\n",
      body: '填写更加详细的变更描述[可选]。使用 "|" 换行 :\n',
      breaking: '列举非兼容性重大的变更[可选]。使用 "|" 换行 :\n',
      footerPrefixsSelect: "选择关联issue前缀[可选]:",
      customFooterPrefixs: "输入自定义issue前缀 :",
      footer: "列举关联issue [可选] 例如: #31, #I3244 :\n",
      confirmCommit: "是否提交或修改commit ?",
    },
    types: [
      { value: "feat", name: "feat:   🎉  新增功能", emoji: "🎉" },
      { value: "fix", name: "fix:   🐛  修复缺陷", emoji: "🐛" },
      { value: "docs", name: "docs:   📝  文档变更", emoji: "📝" },
      {
        value: "style",
        name: "style:   🎨  代码格式",
        emoji: "🎨",
      },
      {
        value: "refactor",
        name: "refactor:   🔨  代码重构",
        emoji: "🔨",
      },
      { value: "perf", name: "perf:    ⚡️  性能优化", emoji: "⚡️" },
      {
        value: "test",
        name: "test:   ✅  测试",
        emoji: "✅",
      },
      {
        value: "build",
        name: "build:   📦️  打包构建",
        emoji: "📦️",
      },
      { value: "ci", name: "ci:   👷  CI 配置变更", emoji: "👷" },
      { value: "revert", name: "revert:   ⏪️  代码回退", emoji: "⏪️" },
      {
        value: "chore",
        name: "chore:   🚀  构建/工程依赖/工具",
        emoji: "🚀",
      },
      { value: "wip", name: "wip:   🚧  正在开发中", emoji: "🚧" },
      { value: "workflow", name: "workflow:   🎯  工作流程改进", emoji: "🎯" },
    ],
    useEmoji: true,
    scopes: [],
    customScopesAlign: "bottom",
    emptyScopesAlias: "empty",
    customScopesAlias: "custom",
    allowBreakingChanges: ["feat", "fix"],
    skipQuestions: ["scope", "body", "breaking", "footerPrefix", "footer"], // 自定义选择指定的问题不显示
  },
};